package user

import (
	"context"
	"git.myscrm.cn/golang/stark/v4"
)

type UserApplyRepo struct {
}

// NewUserApplyRepo
// 构造函数
func NewUserApplyRepo() UserApplyRepoIface {
	return &UserApplyRepo{}
}

func (r *UserApplyRepo) SaveUserApply(ctx context.Context, userApply *CommonUserApply) (*CommonUserApply, error) {
	db := stark.MySQLConn.Get(ctx)

	err := db.Save(userApply).Error
	if err != nil {
		return nil, err
	}

	return userApply, nil
}
